package windows;

import controllers.MainMenu;

public class WindowManager {
	
	public static ServerConnect 	serverConnect;
	public static MainMenu 			mainMenu;
	public static CreateNewGame 	createNewGame;
	public static JoinExistingGame 	joinExistingGame;
	public static GameLobby 		gameLobby;
	public static GameConsole		gameConsole;
	public static Scenarios			scenarios;
	
	
	public Object[] Windows = {serverConnect, mainMenu, createNewGame};
	
	public WindowManager(){
		serverConnect 		= new ServerConnect		(this);
		mainMenu 			= new MainMenu			(this);
		createNewGame 		= new CreateNewGame		(this);
		joinExistingGame 	= new JoinExistingGame	(this);
		gameLobby			= new GameLobby			(this);
		gameConsole			= new GameConsole		(this);
		scenarios			= new Scenarios			(this);
		
		init();
	}
	
	public void init(){
		serverConnect.setVisible(true);
	}
	
	public void showWindow(Object o){
		// hide all windows
		serverConnect.setVisible(false);
		mainMenu.setVisible(false);
		createNewGame.setVisible(false);
		joinExistingGame.setVisible(false);
		gameLobby.setVisible(false);
		gameConsole.setVisible(false);
		scenarios.setVisible(false);
		
		// show the new window
		((java.awt.Window) o).setVisible(true);
	}
}
